package com.example.m;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private EditText edtTxtMainpartID;
    private Button btnMainbuy;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
   initView();

   btnMainbuy.setText("确定");

   btnMainbuy.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View view) {
           String inpt=edtTxtMainpartID.getText().toString();
           int num=Integer.parseInt(inpt);
           Log.i("TAG", "onClick:"+num);
       }
   });

   }

    private void initView() {
        edtTxtMainpartID = (EditText) findViewById(R.id.edtTxtMainpartID);
        btnMainbuy = (Button) findViewById(R.id.btnMainbuy);
    }
}